<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>菜鸭论坛首页</title>
<link rel="stylesheet" type="text/css" href="${root }/css/common.css">
<link rel="stylesheet" type="text/css" href="${root }/css/index.css">
</head>
<body>
	<jsp:include page="header.jsp"></jsp:include>
	<nav><div><a href="index.do">首页</a></div></nav>
	<table border = "1">
		<tr>
			<td>板块名称</td>
			<td>主贴数量</td>
			<td>最后发表</td>
		</tr>
		<c:forEach var="parent" items="${sectionList }">
			<tr>
				<!-- 主板块名称 -->
				<td colspan="3" class="parentSectionTd"><span>${parent.section.sname }</span></td>
			</tr>
			<c:forEach var="child" items="${parent.childSectionList }">
				<tr>
					<!-- 子版块名称 -->
					<td><a href="topic.do?sid=${child.section.sid }&page=1">${child.section.sname }</a></td>
					<!-- 主贴数量 -->
					<td>${child.topicCount }</td>
					<!-- 最新主贴标题 -->
					<td><a href="replay.do?tid=${child.lastTopic.tid }&page=1">${child.ttitle }</a></td>
				</tr>
			</c:forEach>
		</c:forEach>
	</table>
	<jsp:include page="footer.jsp"></jsp:include>
</body>
</html>